#!/usr/bin/env bash
cd /Workspace

groupadd apache
useradd -g apache -s /sbin/nologin -M apache
tar -jxvf httpd-2.2.17.tar.bz2
cd httpd-2.2.17
cd srclib/apr
./configure --prefix=/tools/httpd/apr --enable-threads --enable-other-child --enable-static
make && make install
cd ../apr-util/
./configure --prefix=/tools/httpd/apr-util --with-apr=/tools/httpd/apr
make && make install
cd ../../
./configure --prefix=/tools/httpd --enable-so --enable-rewrite --enable-ssl --with-apr=/tools/httpd/apr --with-apr-util=/tools/httpd/apr-util/
make && make install
cp /tools/httpd/bin/apachectl  /etc/rc.d/init.d/httpd
chkconfig --add httpd
chkconfig httpd on